<?php 
if ($codMenu=='agen' || $bAllMenuOpen) {
   $objSess->setReqSV('agenda', 'dataAge', date('d/m/Y'));
	$contaRigheMenu += 5;
	$aVistaAge['Sett'] = 'settimanale';
	$aVistaAge['List'] = 'giornaliera';
	$aVistaAge['Mens'] = 'mensile';
	$aOpt1 = array("onChange"=>"cambiaDataAge();");
	echo getHtmlForm('formVistaAge');
	echo getHtmlHidden('xsn');
	echo getHtmlHidden('vistaAge');
   if ($codMenu=='agen') {
      $cltit = 'tit1';
      $fgcol = OVF_COLORE_TESTO;
      $bgcol = OVF_COLORE_SFONDO;
   } else {
      $cltit = 'lab1';
      $fgcol = '444444';
      $bgcol = 'dddddd';
   }
?>
<script type="text/javascript">
<!--
function cambiaDataAge() {
   document.formVistaAge.action = '<?=OVF_URL_ROOT?>/app/agen/agenView.php';
   document.formVistaAge.submit();
}
function clickVistaAge(vista) {
   document.formVistaAge.action = '<?=OVF_URL_ROOT?>/app/agen/agenView.php';
   document.formVistaAge.vistaAge.value = vista;
   document.formVistaAge.submit();
}
function goOggi() {
	document.formVistaAge.action = '<?=OVF_URL_ROOT?>/app/agen/agenView.php';
	document.formVistaAge.dataAge.value = "<?=date("d/m/Y")?>";
	document.formVistaAge.submit();
}
function apriAgenSelez() {
	window.open('agenSelez.php?xsn=<?=XSN?>','agenSelez'
		,'top=200,left=200,height=600,width=700,scrollbars=yes,resizable=yes');
}
function apriAgenSelTipoImp() {
	window.open('agenSelTipoImp.php?xsn=<?=XSN?>','agenSelTipoImp'
		,'top=210,left=210,height=600,width=700,scrollbars=yes,resizable=yes');
}
//-->
</script>
<div class='<?=$cltit?>' style='text-align:left;padding:1px 1px 0px 1px;background-color:<?=$bgcol?>;margin-bottom:0px;'>
	<div class='<?=$cltit?>' style='padding:2px;'>
		<a class='<?=$cltit?>' href="<?=OVF_URL_ROOT?>/app/agen/agenView.php?xsn=<?=XSN?>">
		<?=getHtmlImgGen('Agenda', 140, 20, $bgcol, $fgcol, 12)?></a>
	</div>
	<div class='cmd1' style='padding:5px 0px 8px 5px;background-color:#ffffff;'>
		<div class='cmd1' style='padding:3px 0px 3px 0px;'>
			<?php 
			echo getHtmlDate('dataAge','@REQ','formVistaAge',$aOpt1);
			?>
			&nbsp;<a class='cmd1' href="javascript:cambiaDataAge();"><?=_t("go")?></a>
		</div>
		<div class='cmd1' style='padding:3px 0px 3px 0px;'>
		<a class='cmd1' href="javascript:goOggi();"><?=_t("vai a oggi")?></a>
		</div>
		<?
		if (substr($_SERVER['PHP_SELF'],-12)=='agenView.php') {
		?>
		<br/>
		<div class='cmd1' style='padding:3px 0px 3px 0px;'>
		<a class='cmd1' href="<?=OVF_URL_ROOT?>/app/agen/agenView.php?listAge=<?=$objSess->idUtente?>&xsn=<?=XSN?>"><?=_t("la mia agenda")?></a>
		</div>
		<div class='cmd1' style='padding:3px 0px 3px 0px;'>
		<a class='cmd1' href="javascript:apriAgenSelez();"><?=_t("seleziona agende")?></a>
		</div>
		<div class='cmd1' style='padding:3px 0px 3px 0px;'>
		<a class='cmd1' href="javascript:apriAgenSelTipoImp();"><?=_t("seleziona tipo impegno")?></a>
		</div><br/>
		<div class='cmd1' style='padding:3px 0px 3px 0px;'>
		<a class='cmd1' href="javascript:alert('-- to do --');//<?=OVF_URL_ROOT?>/app/agen/agenView.php?xsn=<?=XSN?>"><?=_t("ricerca")?></a>
		</div>
      <br/>
      <div class='cmd1' style='padding:3px 0px 3px 0px;'>
         <a class='cmd1' href="<?=OVF_URL_ROOT?>/app/agen/memoIns.php?xsn=<?=XSN?>"><?=_t("nuovo memo")?></a>
      </div>
      <div class='cmd1' style='padding:3px 0px 3px 0px;'>
         <a class='cmd1' href="<?=OVF_URL_ROOT?>/app/agen/impeIns.php?xsn=<?=XSN?>"><?=_t("nuovo impegno")?></a>
      </div>
		<?
		} else {
		?>
		<br/>
		<div class='cmd1' style='padding:3px 0px 3px 0px;'>
			<?=_t("la mia agenda")?>
		</div>
		<div class='cmd1' style='padding:3px 0px 3px 0px;'>
			<?=_t("seleziona agende")?>
		</div>
		<div class='cmd1' style='padding:3px 0px 3px 0px;'>
			<?=_t("selez. tipo impegno")?>
		</div><br/>
		<div class='cmd1' style='padding:3px 0px 3px 0px;'>
			<?=_t("ricerca")?>
		</div>
		<?
		}
		?>
	</div>
</div>
<?php 
$sStileM = $sStileS = $sStileL = "color:#444444;background-color:#dddddd;";
if (reqVar('vistaAge')=='Mens') {
	$sStileM = "color:".$fgcol.";background-color:".$bgcol.";";
} elseif (reqVar('vistaAge')=='Sett') {
	$sStileS = "color:".$fgcol.";background-color:".$bgcol.";";
}else {
	$sStileL = "color:".$fgcol.";background-color:".$bgcol.";";
}
$sStileZ = "text-align:center;font-size:9pt;font-weight:bold;cursor:pointer;";
?>
<table cellspacing='1' cellpadding='2' width='100%' class='<?=$cltit?>' style="margin-bottom:2px;">
	<tr>
		<td onClick="clickVistaAge('List');" style='<?=$sStileL.$sStileZ?>' width='33%'><?=_t("LISTA")?></td>
		<td onClick="clickVistaAge('Mens');" style='<?=$sStileM.$sStileZ?>' width='33%'><?=_t("MESE")?></td>
		<td onClick="clickVistaAge('Sett');" style='<?=$sStileS.$sStileZ?>' width='33%'><?=_t("SETT.")?></td>
	</tr>
</table>
<?php 
	echo "</form>";
} else {
	$contaRigheMenu += 2;
?>
<div class='lab1' style='padding:1px;margin-bottom:2px;'>
	<div class='lab1' style='padding:2px;'>
	<a class='lab1' href="<?=OVF_URL_ROOT?>/app/agen/agenView.php?xsn=<?=XSN?>">
	<?=getHtmlImgGen('Agenda', 140, 20, 'dddddd', '000000', 12)?></a>
	</div>
</div>
<?php 
}

